<template name="mapReduceOptions">
    {{#if isOptionSelected "OUT"}}
        {{> out}}
    {{/if}}
    {{#if isOptionSelected "QUERY"}}
        {{> selector}}
    {{/if}}
    {{#if isOptionSelected "SORT"}}
        {{> sort}}
    {{/if}}
    {{#if isOptionSelected "LIMIT"}}
        {{> limit}}
    {{/if}}
    {{#if isOptionSelected "FINALIZE"}}
        {{> finalize}}
    {{/if}}
    {{#if isOptionSelected "SCOPE"}}
        {{> scope}}
    {{/if}}
    {{#if isOptionSelected "VERBOSE"}}
        {{> verbose}}
    {{/if}}
    {{#if isOptionSelected "KEEP_TEMP"}}
        {{> keepTemp}}
    {{/if}}
    {{#if isOptionSelected "JS_MODE"}}
        {{> jsMode}}
    {{/if}}
    {{#if isOptionSelected "BYPASS_DOCUMENT_VALIDATION"}}
        {{> bypassDocumentValidation}}
    {{/if}}
</template>

<template name="keepTemp">
    <div class="form-group">
        <label class="col-lg-1 control-label">{{_ "keep_temp"}}
        </label>
        <div id="divKeeptemp" class="col-lg-11">
            <input id="inputKeeptemp" type="checkbox"
                   class="form-control"
                   checked=""
                   style="position: absolute; opacity: 0;"/>
            <span class="help-block m-b-none">{{{_ "keep_temp_info"}}}</span>
        </div>
    </div>
</template>

<template name="jsMode">
    <div class="form-group">
        <label class="col-lg-1 control-label">{{_ "js_mode"}}
        </label>
        <div id="divJsMode" class="col-lg-11">
            <input id="inputJsMode" type="checkbox"
                   class="form-control"
                   checked=""
                   style="position: absolute; opacity: 0;"/>
            <span class="help-block m-b-none">{{{_ "js_mode_info"}}}</span>
        </div>
    </div>
</template>

<template name="out">
    <div class="form-group">
        <label class="col-lg-1 control-label">{{_ "out"}}</label>
        <div id="divOut" class="col-lg-11">
            <textarea id="txtOut" class="form-control"></textarea>
            <span class="help-block m-b-none">{{{_ "out_info"}}}</span>
        </div>
    </div>
</template>

<template name="finalize">
    <div class="form-group">
        <label class="col-lg-1 control-label">{{_ "finalize"}}</label>
        <div id="divFinalize" class="col-lg-11">
            <textarea id="txtFinalize" class="form-control"></textarea>
            <span class="help-block m-b-none">{{{_ "valid_function_info"}}}</span>
        </div>
    </div>
</template>

<template name="scope">
    <div class="form-group">
        <label class="col-lg-1 control-label">{{_ "scope"}}</label>
        <div id="divScope" class="col-lg-11">
            <textarea id="txtScope" class="form-control"></textarea>
        </div>
    </div>
</template>

<template name="verbose">
    <div class="form-group">
        <label class="col-lg-1 control-label">{{_ "verbose"}}</label>
        <div class="col-lg-11">
            <div id="divVerbose" class="i-checks">
                <input id="inputVerbose" type="checkbox" value=""
                       class="form-control"
                       checked=""
                       style="position: absolute; opacity: 0;"/>
            </div>
        </div>
    </div>
</template>